/**
 * storage.js
 * 浏览器存储
 * @author HLonlin <1021944439@qq.com>
 */
export const sessionStorage = {
  setItem (key, value) {
    window.sessionStorage.setItem(key, JSON.stringify(value))
  },

  getItem (key) {
    return JSON.parse(window.sessionStorage.getItem(key))
  },

  remove (key) {
    window.sessionStorage.removeItem(key)
  }
}
export const localStorage = {
  setItem (key, value) {
    window.localStorage.setItem(key, JSON.stringify(value))
  },

  getItem (key) {
    return JSON.parse(window.localStorage.getItem(key))
  },

  remove (key) {
    window.localStorage.removeItem(key)
  }
}